//creatRouter: 用于创建路由
//createWebHashHistory: 用于设置路由模式为哈希模式
import {createRouter, createWebHashHistory} from 'vue-router'
//定义路由匹配规则
const routes = [
    {   // 设置404路由匹配规则
        path: '/:pathMatch(.*)*',
        name: 'NotFound',
        component: () => import('@/views/404.vue')
    },
    {
        path: '/login',
        component: () => import('@/views/login.vue')
    },
    {
        path: '/home',
        component: () => import('@/components/HelloWorld.vue')
    }
]
//创建路由实例对象
const router = createRouter({
    //路由模式
    history: createWebHashHistory(),
    //路由匹配规则
    routes
})
// 导出路由实例对象
export default router